"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.previewDirective = void 0;
var vue_1 = require("vue");
var index_vue_1 = require("../index.vue");
exports.previewDirective = {
    mounted: function (el, binding) {
        // 点击元素时触发预览
        el.addEventListener('click', function () {
            console.log('点击元素触发预览', binding.value);
            var vNode = (0, vue_1.h)(index_vue_1.default, {
                isPreviewOpen: true,
                filePreviewLink: "".concat(binding.value.url),
                fileName: binding.value.name,
                // 时间戳
                keyTimer: new Date().getTime(),
            });
            (0, vue_1.render)(vNode, document.body);
        });
    }
};
